import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const ranking = () => import("../views/tab/ranking.vue");
// const singer = () => import("../views/tab/singer.vue");
const search = () => import("../views/tab/search.vue");
const recommend = () => import("../views/tab/recommend.vue");
const user = () => import("../views/user/user.vue");
const singer = () => import("../views/tab/singer.vue");
import detail from "../components/detail/detail.vue";

const routes = [
  { path: "/ranking", component: ranking },
  {
    path: "/singer",
    component: singer,
    //添加子路由 别忘了!!!!   => :id
    children: [{ path: "detail/:id", component: detail }],
  },
  { path: "/search", component: search },
  { path: "/recommend", component: recommend },
  { path: "/user", component: user },
  { path: "/", redirect: "/recommend" },
];

const router = new VueRouter({
  routes,
});
export default router;
